import { createRouter, createWebHistory } from 'vue-router'
import Login from '../pages/login/login.vue'
import Index from '../pages/index/index.vue'
import BorrowRequest from '../pages/common-use/borrow-request.vue'
import DataStatistics from '../pages/common-use/data-statistics.vue'
import NewMaterial from '../pages/common-use/new-material.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/login'
    },
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '/index',
      name: 'Index',
      component: Index
    },
    {
      path: '/borrow-request',
      name: 'BorrowRequest',
      component: BorrowRequest
    },
    {
      path: '/data-statistics',
      name: 'DataStatistics',
      component: DataStatistics
    },
    {
      path: '/new-material',
      name: 'NewMaterial',
      component: NewMaterial
    }
  ],
})

export default router
